package com.fesine.ch02.atomicIntegerNoSafe;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/7/14 11:13
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/14 11:13
 */
public class MyService {
    public static AtomicLong aiRef = new AtomicLong();
    synchronized public void addNum() {
        System.out.println(Thread.currentThread().getName()
                +" 加了100之后的值是："+aiRef.addAndGet(100));
        aiRef.addAndGet(1);
    }
}
